package com.ecoolex.chinadutyfree.retailer.api.graphql;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.lang.NonNull;

import com.ecoolex.chinadutyfree.retailer.entity.Store;
import com.ecoolex.chinadutyfree.retailer.ws.UnionPayStoreService;
import com.ecoolex.framework.modularize.api.auth.user.ConsumerMemberAuthority;
import com.ecoolex.framework.web.api.graphql2.annotation.GraphQL2Module;
import com.ecoolex.framework.web.api.graphql2.annotation.QueryField;
import com.ecoolex.framework.web.api.graphql2.annotation.GraphQL2Module.Type;

@GraphQL2Module(type = Type.User, description = "商户信息")
public class StoreGraphql {

	@Reference
	private UnionPayStoreService unionPayStoreService;
	
	@QueryField(field = "store",description = "商户信息")
	public Store get(@NonNull String storeId,ConsumerMemberAuthority user) {
		return unionPayStoreService.get(storeId);
	}
}
